package com.example.backed.mapper;

import com.example.backed.entity.OrderItem;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;

@Mapper
public interface OrderItemMapper {
    /**
     * 批量插入订单项
     */
    int batchInsert(@Param("items") List<OrderItem> items);

    /**
     * 查询订单的所有订单项
     */
    List<OrderItem> findByOrderId(@Param("orderId") Long orderId);

    /**
     * 删除订单的所有订单项
     */
    int deleteByOrderId(@Param("orderId") Long orderId);

    /**
     * 根据订单ID列表查询订单项
     */
    List<OrderItem> findByOrderIds(@Param("orderIds") List<Long> orderIds);
} 